<template>
  <div class="spanControl-list" style="width: 100%;margin-left: 0!important;">
    <el-card class="box-card card-head" style="margin: 0px; width: 100%; min-height: 99%">
      <div slot="header" class="clearfix">
        <span>查看商品信息</span>
      </div>

      <div class="text item">
        <el-form label-position="left" inline class="display-form">
          <!--<el-form-item label="标识">-->
          <!--<span>{{ goods.EId }}</span>-->
          <!--</el-form-item>-->
          <!--<el-form-item label="名称">-->
          <!--<span>{{ goods.name }}</span>-->
          <!--</el-form-item>-->
          <!--<el-form-item label="商家">-->
          <!--<span>{{ goods.businessId }}</span>-->
          <!--</el-form-item>-->
          <el-form-item label="商家">
            <span>{{ goods.businessName }}</span>
          </el-form-item>
          <el-form-item label="商品名称">
            <span>{{ goods.goodsName }}</span>
          </el-form-item>
          <el-form-item label="商品价格">
            <span>{{ goods.goodsPrice }}</span>
          </el-form-item>
          <el-form-item label="商品原价">
            <span>{{ goods.standardPrice }}</span>
          </el-form-item>
          <el-form-item label="商品简介">
            <span>{{ goods.goodsIntroduction }}</span>
          </el-form-item>
          <el-form-item label="商品类型">
            <span>{{ goods.goodsTypeName }}</span>
          </el-form-item>
          <!--<el-form-item label="商品类型">-->
          <!--<span>{{ goods.goodsTypeId }}</span>-->
          <!--</el-form-item>-->
          <el-form-item label="商品库存">
            <span>{{ goods.inventory }}</span>
          </el-form-item>
          <el-form-item label="商品月售">
            <span>{{ goods.goodsSale }}</span>
          </el-form-item>
          <el-form-item label="商品状态">
            <span>{{ goods.goodsStatus }}</span>
          </el-form-item>
          <!--<el-form-item label="备注">-->
          <!--<span>{{ goods.remark }}</span>-->
          <!--</el-form-item>-->
          <!--<el-form-item label="创建人">-->
          <!--<span>{{ goods.createId }}</span>-->
          <!--</el-form-item>-->
          <el-form-item label="创建时间">
            <span>{{ goods.createDatetime }}</span>
          </el-form-item>
          <!--<el-form-item label="修改人">-->
          <!--<span>{{ goods.updateId }}</span>-->
          <!--</el-form-item>-->
          <el-form-item label="修改时间">
            <span>{{ goods.updateDatetime }}</span>
          </el-form-item>
          <el-form-item label="商品图片">
            <div v-for=" files in fileArray">
              <img height="100px" width="100" style="text-align: center" :src="headerFile+files.attachmentAddr"/>
            </div>
          </el-form-item>
        </el-form>
      </div>
    </el-card>
  </div>
</template>

<script>
  import {GoodsService} from './GoodsService';

  export default {
    components: {},
    data() {
      return {
        fileArray: [],
        headerFile: process.env.BASE_FILE_VIEW,
        goods: {},
      }
    },
    methods: {

      findFile() {
        debugger
        GoodsService.downLoadFileByIDandName({id: '1', name: '111'}).then(res => {
          this.fileArray = res.data
          console.log(JSON.stringify(res.data))
        })
      },

      findGoodsForView(goodsId)//查找商品信息
      {
        GoodsService.findGoodsForView(goodsId).then((resp) => {
          this.goods = resp.data;
        }).catch((error) => {
          this.$message({
            type: 'error',
            message: '查询商品信息出错'
          })
        })
      },
    },
    created() {
      const goodsId = this.$route.params.goodsId;
      this.findGoodsForView(goodsId);
      this.findFile();
    },
  }

</script>
<style scoped lang="scss">

</style>
